<?php

/**
 * WebConfigs form.
 *
 * @package    cms
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class WebConfigsForm extends BaseWebConfigsForm
{
  public function configure()
  {
      $this->removeFields();
      
      $this->widgetSchema['keywords'] = new sfWidgetFormInput();
      $this->widgetSchema['attachment_path'] = new sfWidgetFormInput();
      $this->validatorSchema['title'] = new sfValidatorString(
                array(
                    'min_length'=>3,
                    'max_length'=>150,
                    'required'=>true,
                    'trim'=>true,
                ),
                array(
                    'min_length'=>'标题最短不能少于3个字符',
                    'max_length'=>'标题最长不能超过150个字符',
                    'required'=>'标题必须填写哦',
                )
              );
     
      $this->widgetSchema->setLabels(
                array(
                    'title'=>'标题',
                    'description'=>'描述',
                    'keywords'=>'关键字',
                    'attachment_path'=>'附件地址',
                    'copyright'=>'版权信息',
                    'icp'=>'备案信息',
                )
              );
      
     $this->widgetSchema->setDefaults(
                array(
                    'title'=>'Storm-CMS',
                    'description'=>'本网站是一个CMS',
                    'keywords'=>'php,mysql,web,css,html,js',
                    'attachment_path'=>'附件地址',
                    'copyright'=>'版权信息',
                    'icp'=>'备案信息',
                )
             );
     $this->widgetSchema->setHelps(
                array(
                    'keywords'=>'多个关键字请用逗号（，）分割',
                )
             );
  }

  protected function removeFields()
  {
      unset(
              $this['created_at'],$this['updated_at']
              );
  }

}
